package com.gitee.dbswitch.admin.type;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum TaskTypeEnum {

    DBASSIGNMENT("数据库","db"),
    APIASSIGNMENT("API","api"),
    ;

    private String name;
    private String value;

    public static TaskTypeEnum of(String value) {
        for (TaskTypeEnum status : TaskTypeEnum.values()) {
            if (status.name().equalsIgnoreCase(value)) {
                return status;
            }
        }

        throw new IllegalArgumentException("cannot find enum name: " + value);
    }
}
